package cn.edu.zut.project1.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data

public class RegisterDTO {
    @NotBlank(message = "账号不能为空")
    @Size(min = 2, max = 20, message = "账号的长度为2-20")
    private String userAccount;// 注册账号

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,20}$",message = "密码长度为6-20,包括字母，数字")
    private String userPassword; // 注册密码

    @NotBlank(message = "确认密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,20}$",message = "密码长度为6-20,包括字母，数字")
    private String confirmPassword; //注册确认密码

    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$", message = "邮箱格式不正确")
    private String userEmail;


}
